<script setup lang="ts">
const iconNavs: { icon: string; color: string; title: string; path: string }[] = [
  {
    icon: 'User',
    color: '#0ea5e9',
    title: '用户',
    path: '/user/list'
  },
  {
    icon: 'shopping-cart',
    color: '#8b5cf6',
    title: '商品',
    path: '/goods/list'
  },
  {
    icon: 'tickets',
    color: '#d946ef',
    title: '分类',
    path: '/category/list'
  },
  {
    icon: 'Ticket',
    color: '#f59e0b',
    title: '优惠券',
    path: '/coupon/list'
  },
  {
    icon: 'Platform',
    color: '#10b981',
    title: 'SKU',
    path: '/skus/list'
  },
  {
    icon: 'Document',
    color: '#14b8a6',
    title: '订单',
    path: '/order/list'
  },
  {
    icon: 'Setting',
    color: '#f55772',
    title: '设置',
    path: '/setting/list'
  },
  {
    icon: 'Management',
    color: '#10b981',
    title: '会员',
    path: '/member/list'
  }
]
</script>

<template>
  <div style="margin-top: 10px">
    <el-row :gutter="20">
      <el-col :span="3" v-for="(item, index) in iconNavs" :key="index">
        <!-- @vue-expect-error  -->
        <el-card shadow="hover" @click="$router.push(item.path)">
          <div class="card-body">
            <el-icon :size="20" :color="item.color">
              <component :is="item.icon" />
            </el-icon>
            <span class="text">{{ item.title }}</span>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<style lang="scss" scoped>
.card-body {
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  .text {
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
  }
}
</style>
